import React from 'react'
import { Cells, Cell, CellBody, CellHeader } from 'react-weui'

export default class ProductSelectHead extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            goods: {}
        }
    }
    componentWillReceiveProps(nextProps) {
        if(nextProps.goodData!==undefined) {
            this.setState({ goods: nextProps.goodData.goods})
        }
    }
	render() {
        const { goodData } = this.props;
		return (
            <Cell>
                <CellHeader style={{position: 'relative', marginRight: '10px',width:'100px'}}>
                  <img src={this.state.goods.thumb} style={{ width: '55px' }} />
                </CellHeader>
                <CellBody>
                    <p style={{ color: 'orange', fontSize: '1.3em'}}>￥{this.state.goods.price}</p>
                    <p style={{ fontSize: '13px', color: '#888888' }}>库存：{this.state.goods.total_amount}</p>
                </CellBody>
            </Cell>

		);
	}
}
